package com.designmode.singleton;

/**
 * 静态内部类  实现 单例模式
 *
 *  Runtime  源码中 使用了此模式
 * @Author ifredomvip@gmail.com
 * @Date 2022/12/7 22:11
 */
public class SingletonStatic {

    SingletonStatic() {

    }

    // 静态内部类
    private static class InnerSingleton{
        private static final SingletonStatic INSTANCE = new SingletonStatic();
    }

    public static SingletonStatic getInstance(){
        return InnerSingleton.INSTANCE;
    }
}
